package demo;

import java.lang.reflect.Constructor;
import java.lang.reflect.Parameter;

public class ReflectDemo {
    public static void main(String[] args) {
        Class<person> c = person.class;
        System.out.println("获取所有构造方法");
        Constructor[] constructor = c.getDeclaredConstructors();
        System.out.println(constructor.length);
        for (Constructor cc : constructor) {
            String name = cc.getName();
            System.out.println(name);
            Parameter[] parameters = cc.getParameters();
            for (Parameter pp : parameters) {
                String name1 = pp.getName();
                System.out.println(name1);
                System.out.println(pp.getParameterizedType());
            }
        }
    }
}
